// 统一请求路径前缀在libs/axios.js中修改
import { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest,downloadFileRequest } from '@/libs/axios';


// 文件上传接口
export const uploadFile = "/highset/upload/file"
// 验证码渲染图片接口
export const drawCodeImage = "/highset/common/captcha/draw/"
// 获取菜单
export const getMenuList = "/highset/permission/getMenuList"
// 获取数据字典
export const getDictData = "/highset/dictData/getByType/"
// Websocket
export const ws = "/highset/ws"



// 登陆
export const login = (params) => {
    return postRequest('/login', params)
}
// 获取用户登录信息
export const userInfo = (params) => {
    return getRequest('/user/info', params)
}
// 注册
export const regist = (params) => {
    return postRequest('/user/regist', params)
}
// 初始化验证码
export const initCaptcha = (params) => {
    return getRequest('/common/captcha/init', params)
}
// 发送短信验证码
export const sendSms = (mobile, params) => {
    return getRequest(`/common/captcha/sendSms/${mobile}`, params)
}
// 发送重置密码短信验证码
export const sendResetSms = (params) => {
    return postRequest('/common/captcha/sendResetSms', params)
}
// 通过手机重置密码
export const resetByMobile = (params) => {
    return postRequest('/user/resetByMobile', params)
}
// 发送重置密码邮件验证码
export const sendResetEmail = (params) => {
    return postRequest('/email/sendResetCode', params)
}
// 通过邮件重置密码
export const resetByEmail = (params) => {
    return postRequest('/email/resetByEmail', params)
}
// 短信验证码登录
export const smsLogin = (params) => {
    return postRequest('/user/smsLogin', params)
}
// IP天气信息
export const ipInfo = (params) => {
    return getRequest('/common/ip/info', params)
}
// 个人中心编辑
export const userInfoEdit = (params) => {
    return postRequest('/user/edit', params)
}
// 个人中心发送修改邮箱验证邮件
export const sendCodeEmail = (email, params) => {
    return getRequest(`/email/sendCode/${email}`, params)
}
// 个人中心发送修改邮箱验证邮件
export const editEmail = (params) => {
    return postRequest('/email/editEmail', params)
}
// 个人中心修改密码
export const changePass = (params) => {
    return postRequest('/user/modifyPass', params)
}
// 个人中心修改手机
export const changeMobile = (params) => {
    return postRequest('/user/changeMobile', params)
}
// 解锁
export const unlock = (params) => {
    return postRequest('/user/unlock', params)
}



// github登录
export const githubLogin = (params) => {
    return getRequest('/social/github/login', params)
}
// qq登录
export const qqLogin = (params) => {
    return getRequest('/social/qq/login', params)
}
// 微博登录
export const weiboLogin = (params) => {
    return getRequest('/social/weibo/login', params)
}
// 绑定账号
export const relate = (params) => {
    return postRequest('/social/relate', params)
}
// 获取JWT
export const getJWT = (params) => {
    return getRequest('/social/getJWT', params)
}



// 获取绑定账号信息
export const relatedInfo = (username, params) => {
    return getRequest(`/relate/getRelatedInfo/${username}`, params)
}
// 解绑账号
export const unRelate = (params) => {
    return postRequest('/relate/delByIds', params)
}
// 分页获取绑定账号信息
export const getRelatedListData = (params) => {
    return getRequest('/relate/findByCondition', params)
}



// 获取用户数据 多条件
export const getUserListData = (params) => {
    return getRequest('/user/getByCondition', params)
}
// 通过用户名搜索
export const searchUserByName = (username, params) => {
    return getRequest('/user/searchByName/'+username, params)
}
// 获取全部用户数据
export const getAllUserData = (params) => {
    return getRequest('/user/getAll', params)
}
// 通过部门获取全部用户数据
export const getUserByDepartmentId = (id, params) => {
    return getRequest(`/user/getByDepartmentId/${id}`, params)
}
// 添加用户
export const addUser = (params) => {
    return postRequest('/user/admin/add', params)
}
// 编辑用户
export const editUser = (params) => {
    return postRequest('/user/admin/edit', params)
}
// 启用用户
export const enableUser = (id, params) => {
    return postRequest(`/user/admin/enable/${id}`, params)
}
// 禁用用户
export const disableUser = (id, params) => {
    return postRequest(`/user/admin/disable/${id}`, params)
}
// 删除用户
export const deleteUser = (ids, params) => {
    return deleteRequest(`/user/delByIds/${ids}`, params)
}
// 导入用户
export const importUserData = (params) => {
    return importRequest('/user/importData', params)
}



// 获取一级部门
export const initDepartment = (params) => {
    return getRequest('/department/getByParentId/0', params)
}
// 加载部门子级数据
export const loadDepartment = (id, params) => {
    return getRequest(`/department/getByParentId/${id}`, params)
}
// 添加部门
export const addDepartment = (params) => {
    return postRequest('/department/add', params)
}
// 编辑部门
export const editDepartment = (params) => {
    return postRequest('/department/edit', params)
}
// 删除部门
export const deleteDepartment = (ids, params) => {
    return deleteRequest(`/department/delByIds/${ids}`, params)
}
// 搜索部门
export const searchDepartment = (params) => {
    return getRequest('/department/search', params)
}



// 获取全部角色数据
export const getAllRoleList = (params) => {
    return getRequest('/role/getAllList', params)
}
// 分页获取角色数据
export const getRoleList = (params) => {
    return getRequest('/role/getAllByPage', params)
}
// 添加角色
export const addRole = (params) => {
    return postRequest('/role/save', params)
}
// 编辑角色
export const editRole = (params) => {
    return postRequest('/role/edit', params)
}
// 设为或取消注册角色
export const setDefaultRole = (params) => {
    return postRequest('/role/setDefault', params)
}
// 分配角色权限
export const editRolePerm = (params) => {
    return postRequest('/role/editRolePerm', params)
}
// 分配角色数据权限
export const editRoleDep = (params) => {
    return postRequest('/role/editRoleDep', params)
}
// 删除角色
export const deleteRole = (ids, params) => {
    return deleteRequest(`/role/delAllByIds/${ids}`, params)
}



// 获取全部权限数据
export const getAllPermissionList = (params) => {
    return getRequest('/permission/getAllList', params)
}
// 添加权限
export const addPermission = (params) => {
    return postRequest('/permission/add', params)
}
// 编辑权限
export const editPermission = (params) => {
    return postRequest('/permission/edit', params)
}
// 删除权限
export const deletePermission = (ids, params) => {
    return deleteRequest(`/permission/delByIds/${ids}`, params)
}
// 搜索权限
export const searchPermission = (params) => {
    return getRequest('/permission/search', params)
}



// 获取全部字典
export const getAllDictList = (params) => {
    return getRequest('/dict/getAll', params)
}
// 添加字典
export const addDict = (params) => {
    return postRequest('/dict/add', params)
}
// 编辑字典
export const editDict = (params) => {
    return postRequest('/dict/edit', params)
}
// 删除字典
export const deleteDict = (ids, params) => {
    return deleteRequest(`/dict/delByIds/${ids}`, params)
}
// 搜索字典
export const searchDict = (params) => {
    return getRequest('/dict/search', params)
}
// 获取全部字典数据
export const getAllDictDataList = (params) => {
    return getRequest('/dictData/getByCondition', params)
}
// 添加字典数据
export const addDictData = (params) => {
    return postRequest('/dictData/add', params)
}
// 编辑字典数据
export const editDictData = (params) => {
    return postRequest('/dictData/edit', params)
}
// 删除字典数据
export const deleteData = (ids, params) => {
    return deleteRequest(`/dictData/delByIds/${ids}`, params)
}
// 通过类型获取字典数据
export const getDictDataByType = (type, params) => {
    return getRequest(`/dictData/getByType/${type}`, params)
}



// 分页获取日志数据
export const getLogListData = (params) => {
    return getRequest('/log/getAllByPage', params)
}
// 删除日志
export const deleteLog = (ids, params) => {
    return deleteRequest(`/log/delByIds/${ids}`, params)
}
// 清空日志
export const deleteAllLog = (params) => {
    return deleteRequest('/log/delAll', params)
}


// 分页获取Redis数据
export const getRedisData = (params) => {
    return getRequest('/redis/getAllByPage', params)
}
// 通过key获取Redis信息
export const getRedisByKey = (key, params) => {
    return getRequest(`/redis/getByKey/${key}`, params)
}
// 获取Redis键值数量
export const getRedisKeySize = (params) => {
    return getRequest('/redis/getKeySize', params)
}
// 获取Redis内存
export const getRedisMemory = (params) => {
    return getRequest('/redis/getMemory', params)
}
// 获取Redis信息
export const getRedisInfo = (params) => {
    return getRequest('/redis/info', params)
}
// 添加编辑Redis
export const saveRedis = (params) => {
    return postRequest('/redis/save', params)
}
// 删除Redis
export const deleteRedis = (params) => {
    return deleteRequest('/redis/delByKeys', params)
}
// 清空Redis
export const deleteAllRedis = (params) => {
    return deleteRequest('/redis/delAll', params)
}



// 分页获取定时任务数据
export const getQuartzListData = (params) => {
    return getRequest('/quartzJob/getAllByPage', params)
}
// 添加定时任务
export const addQuartz = (params) => {
    return postRequest('/quartzJob/add', params)
}
// 编辑定时任务
export const editQuartz = (params) => {
    return postRequest('/quartzJob/edit', params)
}
// 暂停定时任务
export const pauseQuartz = (params) => {
    return postRequest('/quartzJob/pause', params)
}
// 恢复定时任务
export const resumeQuartz = (params) => {
    return postRequest('/quartzJob/resume', params)
}
// 删除定时任务
export const deleteQuartz = (ids, params) => {
    return deleteRequest(`/quartzJob/delByIds/${ids}`, params)
}



// 分页获取消息数据
export const getMessageData = (params) => {
    return getRequest('/message/getByCondition', params)
}
// 获取单个消息详情
export const getMessageDataById = (id, params) => {
    return getRequest(`/message/get/${id}`, params)
}
// 添加消息
export const addMessage = (params) => {
    return postRequest('/message/add', params)
}
// 编辑消息
export const editMessage = (params) => {
    return postRequest('/message/edit', params)
}
// 删除消息
export const deleteMessage = (ids, params) => {
    return deleteRequest(`/message/delByIds/${ids}`, params)
}
// 分页获取消息推送数据
export const getMessageSendData = (params) => {
    return getRequest('/messageSend/getByCondition', params)
}
// 编辑发送消息
export const editMessageSend = (params) => {
    return putRequest('/messageSend/update', params)
}
// 删除发送消息
export const deleteMessageSend = (ids, params) => {
    return deleteRequest(`/messageSend/delByIds/${ids}`, params)
}



// 分页获取文件数据
export const getFileListData = (params) => {
    return getRequest('/file/getByCondition', params)
}
// 复制文件
export const copyFile = (params) => {
    return postRequest('/file/copy', params)
}
// 重命名文件
export const renameFile = (params) => {
    return postRequest('/file/rename', params)
}
// 删除文件
export const deleteFile = (ids, params) => {
    return deleteRequest(`/file/delete/${ids}`, params)
}
// 下载文件
export const aliDownloadFile = (fKey, params) => {
    return getRequest(`/file/ali/download/${fKey}`, params)
}


// 检查oss配置
export const checkOssSet = (params) => {
    return getRequest('/setting/oss/check', params)
}
// 获取oss配置
export const getOssSet = (serviceName, params) => {
    return getRequest(`/setting/oss/${serviceName}`, params)
}
// 编辑oss配置
export const editOssSet = (params) => {
    return postRequest('/setting/oss/set', params)
}
// 获取sms配置
export const getSmsSet = (serviceName, params) => {
    return getRequest(`/setting/sms/${serviceName}`, params)
}
// 获取sms模板code
export const getSmsTemplateCode = (type, params) => {
    return getRequest(`/setting/sms/templateCode/${type}`, params)
}
// 编辑sms配置
export const editSmsSet = (params) => {
    return postRequest('/setting/sms/set', params)
}
// 获取email配置
export const getEmailSet = (serviceName, params) => {
    return getRequest('/setting/email', params)
}
// 编辑email配置
export const editEmailSet = (params) => {
    return postRequest('/setting/email/set', params)
}
// 获取other配置
export const getOtherSet = (params) => {
    return getRequest('/setting/other', params)
}
// 编辑other配置
export const editOtherSet = (params) => {
    return postRequest('/setting/other/set', params)
}
// 查看私密配置
export const seeSecretSet = (settingName, params) => {
    return getRequest(`/setting/seeSecret/${settingName}`, params)
}



// 表格生成
export const generateTable = (name, rowNum, params) => {
    return importRequest(`/generate/table/${name}/${rowNum}`, params)
}
// 树生成
export const generateTree = (name, rowNum, params) => {
    return importRequest(`/generate/tree/${name}/${rowNum}`, params)
}
// 通过实体类生成Vue代码Json数据
export const getEntityData = (path, params) => {
    return getRequest(`/generate/getEntityData/${path}`, params)
}



// base64上传
export const base64Upload = (params) => {
    return postRequest('/upload/file', params)
}





// 添加轮播图
export const addBanner = (params) => {
    return postRequest('/banner/add', params)
}

// 修改轮播图
export const editBanner = (params) => {
    return postRequest('/banner/edit', params)
}

// 获取轮播图列表
export const getBannerList = (params) => {
    return getRequest('/banner/getByCondition', params)
}

// 删除轮播图
export const deleteBanner = (ids, params) => {
    return deleteRequest(`/banner/delByIds/${ids}`, params)
}

// 添加小程序跳转页面
export const addMiniprogramPath = (params) => {
    return postRequest('/miniprogramPath/add', params)
}

// 修改小程序跳转页面
export const editMiniprogramPath = (params) => {
    return postRequest('/miniprogramPath/edit', params)
}

// 获取小程序跳转页面列表
export const getMiniprogramPathList = (params) => {
    return getRequest('/miniprogramPath/getByCondition', params)
}

// 删除小程序跳转页面
export const deleteMiniprogramPath = (ids, params) => {
    return deleteRequest(`/miniprogramPath/delByIds/${ids}`, params)
}
// 获取全部小程序跳转页面
export const getAllMiniprogramPath = (params) => {
    return getRequest('/miniprogramPath/getAll', params)
}


// 添加小程序菜单
export const addMiniprogramMenu = (params) => {
    return postRequest('/miniprogramMenu/add', params)
}

// 修改小程序菜单
export const editMiniprogramMenu = (params) => {
    return postRequest('/miniprogramMenu/edit', params)
}

// 获取小程序菜单列表
export const getMiniprogramMenuList = (params) => {
    return getRequest('/miniprogramMenu/getByCondition', params)
}

// 删除小程序菜单
export const deleteMiniprogramMenu = (ids, params) => {
    return deleteRequest(`/miniprogramMenu/delByIds/${ids}`, params)
}



// 添加视频
export const addVideo = (params) => {
    return postRequest('/video/add', params)
}

// 修改视频
export const editVideo = (params) => {
    return postRequest('/video/edit', params)
}

// 获取视频列表
export const getVideoList = (params) => {
    return postRequest('/video/getByCondition', params)
}

// 删除视频
export const deleteVideo = (ids, params) => {
    return deleteRequest(`/video/delByIds/${ids}`, params)
}



// 添加图片
export const addImage = (params) => {
    return postRequest('/image/add', params)
}

// 修改图片
export const editImage = (params) => {
    return postRequest('/image/edit', params)
}

// 获取图片列表
export const getImageList = (params) => {
    return getRequest('/image/getByCondition', params)
}

// 删除图片
export const deleteImage = (ids, params) => {
    return deleteRequest(`/image/delByIds/${ids}`, params)
}

// 获取交通指南cn
export const getTrafficCn = (params) => {
    return postRequest('/content/getTrafficCn', params)
}
// 更新交通指南cn
export const updateTrafficCn = (params) => {
    return postRequest('/content/updateTrafficCn', params)
}

// 获取展会概要cn
export const getExhibitionOutlineCn = (params) => {
    return postRequest('/content/getExhibitionOutlineCn', params)
}
// 更新展会概要cn
export const updateExhibitionOutlineCn = (params) => {
    return postRequest('/content/updateExhibitionOutlineCn', params)
}
// 获取展会概要en
export const getExhibitionOutlineEn = (params) => {
    return postRequest('/content/getExhibitionOutlineEn', params)
}
// 更新展会概要en
export const updateExhibitionOutlineEn = (params) => {
    return postRequest('/content/updateExhibitionOutlineEn', params)
}



// 获取联系我们cn
export const getContactUsCn = (params) => {
    return postRequest('/content/getContactUsCn', params)
}
// 更新联系我们cn
export const updateContactUsCn = (params) => {
    return postRequest('/content/updateContactUsCn', params)
}
// 获取联系我们en
export const getContactUsEn = (params) => {
    return postRequest('/content/getContactUsEn', params)
}
// 更新联系我们en
export const updateContactUsEn = (params) => {
    return postRequest('/content/updateContactUsEn', params)
}

// 获取展位图描述cn
export const getStandCn = (params) => {
    return postRequest('/content/getStandCn', params)
}
// 更新展位图描述cn
export const updateStandCn = (params) => {
    return postRequest('/content/updateStandCn', params)
}


// 获取一级类别
export const initProductType = (params) => {
    return getRequest('/productType/getByParentId/0', params)
}
// 加载类别子级数据
export const loadProductType = (id, params) => {
    return getRequest(`/productType/getByParentId/${id}`, params)
}
// 添加类别
export const addProductType = (params) => {
    return postRequest('/productType/add', params)
}
// 编辑类别
export const editProductType = (params) => {
    return postRequest('/productType/edit', params)
}
// 删除类别
export const deleteProductType = (ids, params) => {
    return deleteRequest(`/productType/delByIds/${ids}`, params)
}
// 搜索类别
export const searchProductType = (params) => {
    return getRequest('/productType/search', params)
}
// 获取全部类别
export const getAllProductType = (params) => {
    return getRequest('/productType/getAll', params)
}


// 添加展商
export const addExhibitor = (params) => {
    return postRequest('/exhibitor/add', params)
}
// 修改展商
export const editExhibitor = (params) => {
    return postRequest('/exhibitor/edit', params)
}

// 获取展商
export const getExhibitorList = (params) => {
    return postRequest('/exhibitor/getByCondition', params)
}

// 删除展商
export const deleteExhibitor = (ids, params) => {
    return deleteRequest(`/exhibitor/delByIds/${ids}`, params)
}
// 导入展商
export const importExhibitor = (params) => {
    return importRequest('/exhibitor/import', params)
}



// 添加展馆
export const addHall = (params) => {
    return postRequest('/hall/add', params)
}

// 修改展馆
export const editHall = (params) => {
    return postRequest('/hall/edit', params)
}

// 获取展馆列表
export const getHallList = (params) => {
    return getRequest('/hall/getByCondition', params)
}

// 删除展馆
export const deleteHall = (ids, params) => {
    return deleteRequest(`/hall/delByIds/${ids}`, params)
}



// 添加参观时间
export const addVisitTime = (params) => {
    return postRequest('/visitTime/add', params)
}

// 修改参观时间
export const editVisitTime = (params) => {
    return postRequest('/visitTime/edit', params)
}

// 获取参观时间列表
export const getVisitTimeList = (params) => {
    return postRequest('/visitTime/getByCondition', params)
}

// 删除参观时间
export const deleteVisitTime = (ids, params) => {
    return deleteRequest(`/visitTime/delByIds/${ids}`, params)
}


// 添加活动
export const addActivity = (params) => {
    return postRequest('/activity/add', params)
}

// 修改活动
export const editActivity = (params) => {
    return postRequest('/activity/edit', params)
}

// 获取活动列表
export const getActivityList = (params) => {
    return postRequest('/activity/getByCondition', params)
}

// 删除活动
export const deleteActivity = (ids, params) => {
    return deleteRequest(`/activity/delByIds/${ids}`, params)
}

// 添加投票活动
export const addVote = (params) => {
    return postRequest('/vote/add', params)
}

// 修改投票活动
export const editVote = (params) => {
    return postRequest('/vote/edit', params)
}

// 获取投票活动列表
export const getVoteList = (params) => {
    return postRequest('/vote/getByCondition', params)
}

// 删除投票活动
export const deleteVote = (ids, params) => {
    return deleteRequest(`/vote/delByIds/${ids}`, params)
}


// 添加投票活动明细
export const addVoteItem = (params) => {
    return postRequest('/voteItem/add', params)
}

// 修改投票活动明细
export const editVoteItem = (params) => {
    return postRequest('/voteItem/edit', params)
}

// 获取投票活动明细列表
export const getVoteItemList = (params) => {
    return postRequest('/voteItem/getByCondition', params)
}

// 删除投票活动明细
export const deleteVoteItem = (ids, params) => {
    return deleteRequest(`/voteItem/delByIds/${ids}`, params)
}